package com.itheima.网络编程.tcp编程.tcp编程.tcp网络编程;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

public class TcpServer {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(10022);
        Socket accept = ss.accept();

        while (true) {
            InputStream inputStream = accept.getInputStream();
            InputStreamReader isr=new InputStreamReader(inputStream);
            BufferedReader br=new BufferedReader(isr);
            System.out.println(br.readLine());
//            ss.close();
           inputStream.close();
        }
    }
}
